package com.gillion.grule.client.core;

import java.util.HashMap;
import java.util.Map;
import java.util.Objects;

import lombok.Data;
import org.mvel2.MVEL;

@Data
public class Rule {
    private String version;
    private String artifactId;
    private String groupId;
    private String ruleContent;
    // Override equals method
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Rule rule = (Rule) o;
        return Objects.equals(version, rule.version) &&
                Objects.equals(artifactId, rule.artifactId) &&
                Objects.equals(groupId, rule.groupId) &&
                Objects.equals(ruleContent, rule.ruleContent);
    }

    // Override hashCode method
    @Override
    public int hashCode() {
        return Objects.hash(version, artifactId, groupId, ruleContent);
    }

    // Override toString method
    @Override
    public String toString() {
        return "Rule{" +
                "version='" + version + '\'' +
                ", artifactId='" + artifactId + '\'' +
                ", groupId='" + groupId + '\'' +
                ", ruleContent='" + ruleContent + '\'' +
                '}';
    }
}